from Utilities import *
import math

tp = 1.14
co = 1
ub = 1.15e-5
kkk = 44360055615082.54
kkk = 128 * 3.1415926 * 0.4530 * 0.22097 / (0.000976**4)


def calc(d1, d2, t1, t2):
  return (d2**2 - d1**2) / (t2**2 - t1**2)


print(kkk * calc(0.04321, 0.05814, 1.5507, 1.8169))
with open("/tmp/CodeTmp/testdata.in", "r") as f:
  a = f.readlines()

a = [float(i) * co for i in a]

print(a)

sum = 0

for i in a:
  sum += i

aver = sum / len(a)

print("Aver:", aver)

sum = 0
for i in a:
  sum += (i - aver) * (i - aver)

sum /= 20.0

ua = math.sqrt(sum)

print("Ua:", ua)
print("Ub:", ub)
print("U:", math.sqrt((tp * ua)**2 + (ub**2)))

# print(
#     math.sqrt((2 / (2 * 0.30282 + 0.020004))**2 * ((4.14e-4)**2) +
#               ((1 / ((2 * 0.30282 + 0.020004)))**2) * ((1.43e-5)**2) +
#               (2 * 60 / 67.082)**2 * ((4.09e-3)**2)))
